Comment and Uncomment

The comment and uncomment features provide the facility to convert the current selection to and from a language comment. Programmer Studio uses the comment styles defined in the language assigned to the current documentÆs file type.

To convert the current selection into a comment

  1. Select the text which you wish to comment

  2. From the Format menu, select Comment

Commenting a block of text involves adding the comment identifiers into the selected text. If the Code Editor Template defines both single and multi-line comments, the user is prompted to choose which style should be used.

A space is inserted after each single-line comment to ensure that an unrecognized keyword is not created from concatenated words. For example, inserting the keyword COMMENT at the start of the line BEGIN PROGRAM would create an unknown keyword COMMENTBEGIN unless an additional space was inserted after COMMENT.

Uncomment will delete either multi-line or single-line comments from the currently selected string based on the first comment type encountered from the beginning of the selection. If a space is encountered immediately after the comment keyword this will also be deleted.  Please see the paragraph above for more information.